﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using x.Application.Contracts.User;
using x.Application.Contracts.UserDto;
using x.Domain.User;

namespace x.Application.User
{
    public class UserService : IUserService
    {
        private readonly IUserRepository userRepository;
        private readonly IMapper mapper;

        public UserService(IUserRepository userRepository, IMapper mapper)
        {
            this.userRepository = userRepository;
            this.mapper = mapper;
        }
        public int UserAdd(UsersDto usersDto)
        {
            Users users = mapper.Map<Users>(usersDto);
           return  userRepository.UserAdd(users);
        }
    }
}
